{extend name="public:base" /}
{block name="head"}
<link href="__PUBLIC__/view_res/mobile/css/wshop_companyreg.css" type="text/css" rel="Stylesheet" />
<link href="__PUBLIC__/jquery-weui/dist/lib/weui.min.css" type="text/css" rel="Stylesheet" />
<link href="__PUBLIC__/jquery-weui/dist/css/jquery-weui.min.css" type="text/css" rel="Stylesheet" />
<script src="__PUBLIC__/jquery-weui/dist/js/jquery-weui.min.js"></script>
{/block} 

{block name="header"}
{include file="public/top-nav" /}
{/block}

{block name="content"}

<form id="login-wrap">

    <header class="Thead">姓名</header>
    <div style="padding:0 10px;">
        <div class="gs-text">
            <input type="text" readonly="true" name="idcardname" value="{$user.idcardname}"  tabindex="3"/>
        </div>
    </div>
    <header class="Thead">身份证</header>
    <div style="padding:0 10px;">
        <div class="gs-text">
            <input type="text" readonly="true" name="idcard" value="{$user.idcard}"  tabindex="3"/>
        </div>
    </div>
    <header class="Thead">交易所名称</header>
    <div style="padding:0 10px;">
            <div class="gs-text">
            <input type="text" readonly="true" name="name" value="{$trade.name}"  tabindex="3" />
        </div>
    </div>

    <header class="Thead">交易所主账号</header>
    <div style="padding:0 10px;">
        <div class="gs-text">
            <input type="text" name="trade_id" value="{$trade_acc.trade_id}" tabindex="4" placeholder="请输入交易所主账号" />
        </div>
    </div>

    <header class="Thead">确认交易所主账号</header>
    <div style="padding:0 10px;">
        <div class="gs-text">
            <input type="text" name="trade_id_ss" value="{$trade_acc.trade_id}" tabindex="4" placeholder="请输入交易所主账号" />
        </div>
    </div>

    <header class="Thead">交易所副帐号</header>
    <div style="padding:0 10px;">
        <div class="gs-text">
            <input type="text" name="sub_trade_id" value="{$trade_acc.sub_trade_id}" tabindex="4" placeholder="请输入交易所副帐号" />
        </div>
    </div>
    <input type="hidden" readonly="true" name="exchange_id" value="{$trade.id}" tabindex="3" />
    <input type="hidden" readonly="true" name="username" value="{$user.username}" tabindex="3" />

</form>

<a class="button green" href="javascript:;" id="reg-btn">确认绑定</a>


{/block}
{block name="script"}
<script>
$('#reg-btn').click(function(){
	$.post(
		
		'{:url("user/tradeadd")}',
		
		$('input[type="text"],input[type="text"],input[type="hidden"]'),
		function(d){
            if(d.error){
				$.toast(d.error, "forbidden");
			}else if(d.success){
				$.toast(d.success);
				
				setTimeout(function (){
			      history.go(-1);
			    },2000);
			}
		}
	);
});


function send2bank(){
        var i=60;
		var wait=60;
                    //var phone=document.getElementById("mobile").val;
		var phone = $("#code").val();
		//alert(phone);

		document.getElementById("btn").disabled = false;
		$.post("/mobile/user/send2bank",{mobile:encodeURIComponent($("#code").val())},
						function(d){
						   //layer.msg(d.info);
								
							time(document.getElementById("btn"));

						});


    }
</script>

{/block}